package reflection;

public class Test03 {
    public static void main(String[] args) throws ClassNotFoundException {
        Person person = new Student();
        System.out.println(person.name);

        Class<? extends Person> aClass = person.getClass();

        Class<?> aClass1 = Class.forName("reflection.Student");
        Class<Student> studentClass = Student.class;
        System.out.println(aClass.hashCode());
        System.out.println(aClass1.hashCode());
        System.out.println(studentClass.hashCode());
        Class<Integer> type = Integer.TYPE;
        Class<Integer> integerClass = Integer.class;
       /* System.out.println(type.hashCode());
        System.out.println(type);
        System.out.println(integerClass);
        System.out.println(integerClass.hashCode());*/

        Class<?> superclass = aClass1.getSuperclass();
        System.out.println(superclass);
    }
}
class Person{
    String name;

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Person() {
        this.name = "person";
    }

    public Person(String name) {

        this.name = name;
    }
}
class Student extends Person{
    Student(){
        this.name = "student";
    }
}